package com.yinNuo.collectWool.collectWoolHttp;

import com.yinNuo.collectWool.core.constant.KuaiShouConstant;
import com.yinNuo.collectWool.utils.HttpUtils;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;

/**
 * @author: yinNuo
 * create at: 2021/12/16 下午9:05
 * @description: 快手http请求工具类
 */
@Component
@NoArgsConstructor
public class KuaiShouHttps {
    @Autowired
    HttpUtils httpUtils;

    /**
     * 逛街领500任务
     *
     * @return
     */
    public String loogStreet() {
        HttpHeaders headers = new HttpHeaders();
        headers.set("Host", "api2.e.kuaishou.com");
        headers.set("Content-Length", "888");
        MultiValueMap<String, String> map = new LinkedMultiValueMap<>();
        map.add("activityId", "148");
        map.add("cs", "false");
        map.add("sig", "2ea500ffed9a1fa0750912f64b0dbc0c");
        map.add("client_key", "2ac2a76d");
        map.add("__NS_sig3", "47562605af5d092fe5510c0d7254bf791782ac74131e1006");
        map.add("os", "android");//手机需要调整一下
        map.add("kuaishou.api_st", "Cg9rdWFpc2hvdS5hcGkuc3QSoAFgWqf7d8NzbTxmWksjqfXFfVhhGOT9KbZMMxqMPTNqIlMCpBo5xQJ0N0uUqWZQX3kuJd3ZebjQhPhFqW0j-WUHUYCF-Qnb0uMzDkktkoRvcyLiggKbRc4OhlEuaLqlZy-ZXi6ZVG4VBoClrp1mZUaMFT5tXOIvDqY-TB6dCawqlzq624Zax8yVqjaESiLISv-wJcvCF_PTSlFGqxD4jkbmGhJNk_1UD2hFuJqWEjmUf_4qTIUiIGlpTHtKo32OVy62JiZLUY3dDKjI0i8lOimiKaaAxXy2KAUwAQ");
        map.add("token", "Cg9rdWFpc2hvdS5hcGkuc3QSoAFgWqf7d8NzbTxmWksjqfXFfVhhGOT9KbZMMxqMPTNqIlMCpBo5xQJ0N0uUqWZQX3kuJd3ZebjQhPhFqW0j-WUHUYCF-Qnb0uMzDkktkoRvcyLiggKbRc4OhlEuaLqlZy-ZXi6ZVG4VBoClrp1mZUaMFT5tXOIvDqY-TB6dCawqlzq624Zax8yVqjaESiLISv-wJcvCF_PTSlFGqxD4jkbmGhJNk_1UD2hFuJqWEjmUf_4qTIUiIGlpTHtKo32OVy62JiZLUY3dDKjI0i8lOimiKaaAxXy2KAUwAQ");
        map.add("__NStokensig", "81eefccb811e282bc4f40cdd2501b134d413e524ae5e1f280894783de8ca5a18");
        //添加请求参数
        StringBuilder sb =new StringBuilder();
        sb.append("?did=ANDROID_481a5bfa401cadd1");
        String response = httpUtils.postMethod(KuaiShouConstant.LOOK_STREET+sb.toString(), headers, map);
        return response;
    }

}
